A military firearm may have a flash hider threaded to the end of its barrel. The flash hider is intended to reduce both the primary flash caused by the initial explosion of the powder charge when a round of ammunition is fired, and the secondary flash caused when the partially combusted gases and hot air from the barrel reignite following the shock of meeting the colder air surrounding the end of the barrel. The visible flash is an indication of the marksman's location. Hiding the flash makes it difficult to locate that marksman.
A sound suppressor reduces the sound of a firearm being fired for the same objective for which a flash hider reduces flash, namely, to make it more difficult to detect the location of the marksman. A sound suppressor is inherently a flash hider because it is typically a closed cylinder and thus prevents the flash from being seen while it performs its primary function of suppressing sound.
Both a flash hider and a sound suppressor are typically fitted to the threaded end of the barrel of a firearm.